<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{web/layout/default}">

<head>
    <title>User Home Regiseter</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>

<div>


    <div layout:fragment="content">
        <form action="#" th:action="@{/user/register}" th:object="${viewModel}" method="post">
            <p>
                <label>username:</label>
                <input type="text" th:field="*{username}"/>
                <label th:if="${#fields.hasErrors('username')}" th:errors="*{username}">username error</label>
            </p>
            <p>
                <label>password:</label>
                <input type="text" th:field="*{password}"/>
                <label th:if="${#fields.hasErrors('password')}" th:errors="*{password}">password error</label>
            </p>
            <p>
                <input type="submit" value="register"/>
            </p>
        </form>
    </div>

</div>
</body>
</html>